﻿#ifndef WIDGETSERIALPORTCFG_H
#define WIDGETSERIALPORTCFG_H
#include <QWidget>

#include "myhead.h"
#include "basecommunication.h"

namespace Ui {
class WidgetSerialPortCfg;
}

class WidgetSerialPortCfg : public QWidget
{
    Q_OBJECT

public:
    explicit WidgetSerialPortCfg(QWidget *parent = 0);
    ~WidgetSerialPortCfg();

    void setComm(BaseCommunication *comm);

private slots:
    void on_openSerial_clicked();

    void on_closeSerial_clicked();

    void on_btnUpdataSerialPort_clicked();

private:
    Ui::WidgetSerialPortCfg *ui;

    BaseCommunication *_comm;
    QStringList getAvailablePortsString();
    void loadConfig();
    void updateSerialPort();
};

#endif // WIDGETSERIALPORTCFG_H